﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Turntable
{
    public partial class WebForm1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            this.awardsTitle.Text = "奖项设置：";
            this.awards1.Text = "一等奖：网时奖励200小时 。奖品数量：3 ";
            this.awards2.Text = "二等奖：网时奖励100小时 。奖品数量：5 ";
            this.awards3.Text = "三等奖：广播台免费点首歌 。奖品数量：10 ";
            this.rulesTitle.Text = "活动说明：";
            this.rules1.Text = "本次活动每人可以转 3 次 ";
            this.rules2.Text = "我们的中奖率高达50%！！ ";

        }

        protected void btn_inner_Click(object sender, ImageClickEventArgs e)
        {
            int i = RandomHelper.RandomIntValue1(0, 105);

            int[] dataObj1 = { 1,  3,  5, 7, 9, 11 };
            int[] dataObj2 = { 2,  6, 8};
            int[] dataObj3 = { 4, 10};

            int x = RandomHelper.RandomIntValue1(0, dataObj1.Length);
            int y = RandomHelper.RandomIntValue1(0, dataObj2.Length);
            int z = RandomHelper.RandomIntValue1(0, dataObj3.Length);

            int type;
            string price="";

            if (i >= 0 && i < 2) { price = "50元现金红包";  type = 0;}
            else if (i >= 2 && i <5 ) { price = "20元现金红包";  type = dataObj3[z]; }
            else if (i >= 5 && i <15) { price = "10元现金红包";  type = dataObj2[y]; }
            else if (i >= 15 && i < 35) { price = "获得公仔一个";  type = dataObj1[x]; }
            else if (i >= 35 && i < 65) { price = "获得保温杯一个";  type = dataObj1[x]; }
            else{ price = "";  type = dataObj1[x]; }

           
            price= price.Trim();
          

            //Page.RegisterClientScriptBlock( "msg", "<script  language='javascript'>aaaa('');</script>");
            Page.ClientScript.RegisterStartupScript(GetType(), "msg", "<script>rotateFunc('"+price+"',"+type+")</script>");
            //Page.ClientScript.RegisterStartupScript(GetType(), "aaaa", "<script>aaaa('')</script>");
        }


    }
}